#include "MeshFbx.h"
#include "Shader.h"
#include "Effect.h"
CMeshFbx::CMeshFbx()
:m_pEffect(NULL)
{
}

CMeshFbx::~CMeshFbx(void)
{

}

bool CMeshFbx::Initialize( KFbxMesh *pMesh)
{
	if ( pMesh == NULL && pMesh->GetNode() == NULL )
		return false;

	int bHasNormal = pMesh->GetElementNormalCount();
	KFbxGeometryElement::EMappingMode lNormaMappintMode = KFbxGeometryElement::eNONE;

	if ( bHasNormal  )
	{
		lNormaMappintMode = pMesh->GetElementNormal(0)->GetMappingMode();
		if ( lNormaMappintMode != KFbxGeometryElement::eBY_CONTROL_POINT  )
		{
		}
		//add the normal 
	}

	int bHasUV		= pMesh->GetElementUVCount();
	KFbxGeometryElement::EMappingMode lUVMappingMode = KFbxGeometryElement::eNONE;

	if ( bHasUV )
	{
		lUVMappingMode = pMesh->GetElementUV(0)->GetMappingMode();
		if( lUVMappingMode != KFbxGeometryElement::eBY_CONTROL_POINT  )
		{

		}
		// add UV 
	}	

	KFbxGeometryElement::EMappingMode lColorMappingMode = KFbxGeometryElement::eNONE;
	int bHasColor = pMesh->GetElementVertexColorCount();
	if ( bHasColor )
	{
		lColorMappingMode = pMesh->GetElementVertexColor(0)->GetMappingMode();
		if ( lColorMappingMode != KFbxGeometryElement::eBY_CONTROL_POINT  )
		{

		}
		// add color
	}

	// if not do create function, so effect using the default shader script


	return true;
}

void CMeshFbx::UpdateFrame()
{

}

void CMeshFbx::BeginDraw()
{

}

void CMeshFbx::DrawFrame()
{
	if ( m_pEffect )
		m_pEffect->Activate();

	//glDrawElements( GL_TRIANGLES, )
}

void CMeshFbx::EndDraw()
{
}

